include $(TOPDIR)/rules.mk

PKG_NAME:=lte
PKG_VERSION:=0.1.0

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/lte-Quectel
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE+=utils
endef

define Package/lte-Quectel/description
  lte is gpn device support Quectel.
endef

define Package/lte-led
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE+=utils
endef

define Package/lte-led/description
  lte-led add for YiWei devices check lte led
endef

define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)

define Package/lte-Quectel/install
	$(INSTALL_DIR) $(1)/etc/uci-defaults
	$(INSTALL_BIN) ./files/lte_quectel/lte.default $(1)/etc/uci-defaults/lte
	$(INSTALL_DIR) $(1)/lib
	$(INSTALL_BIN) ./files/lte_quectel/hclfuncs.sh $(1)/lib/hclfuncs.sh
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) ./files/lte_quectel/lte_quectel.lua $(1)/usr/sbin/lte_quectel
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) ./files/lte_quectel/quectel-CM $(1)/usr/sbin/quectel-CM
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) ./files/lte_quectel/atserial $(1)/usr/sbin/atserial
	$(INSTALL_DIR) $(1)/usr/share/lua
	$(INSTALL_BIN) ./files/lte_quectel/hstr.lua $(1)/usr/share/lua/hstr.lua
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) ./files/lte_quectel/lteconfig $(1)/etc/config/lteconfig
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) ./files/lte_quectel/lte.init $(1)/etc/init.d/lte
endef

define Package/lte-led/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) ./files/lte_led/lte_led_check.sh $(1)/usr/sbin/lte_led_check
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) ./files/lte_led/lte_led.init $(1)/etc/init.d/lte_led
endef

$(eval $(call BuildPackage,lte-Quectel))
$(eval $(call BuildPackage,lte-led))
